package com.zzl.boot.bigevent.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@NoArgsConstructor
@AllArgsConstructor
@Data
public class result<T> {
    private Integer code;
    private String msg;
    private T data;
    public static <E> result<E> success(E data) {
        return new result<>(0,"操作成功",data);
    }
    public static result success() {
        return new result(0,"操作成功",null);
    }
    public static result error(String msg) {
        return new result(1,msg,null);
    }
}
